package com.devin.service.Impl;

import com.devin.dao.LogMapper;
import com.devin.dao.MultiMapper;
import com.devin.pojo.LogInfo;
import com.devin.service.LogService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.swing.plaf.multi.MultiInternalFrameUI;
import java.util.List;

@Service("logService")
@Transactional
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Autowired
    private MultiMapper multiMapper;

    @Override
    public List<LogInfo> getLogs(Integer page, Integer size) {
        PageHelper.startPage(page,size);
        return logMapper.getLogs();
    }

    @Override
    public void delLog(Integer logId) {
        logMapper.delLog(logId);
    }

    @Override
    public void delLogsChecked(Integer[] ids) {
        multiMapper.delLogsChecked(ids);
    }

    @Override
    public void saveLog(LogInfo logInfo) {
        logMapper.saveLog(logInfo);
    }
}
